import React from 'react';

/** 申请页面上下文类型 */
export interface IChangeContextAPI {
  styleFixCls: string;
  infoObj: Record<string, any>;
  reloadDetail: () => void;
  invalidState: Record<string, any>;
  setInvalidState: (resObj: Record<string, any>) => void;
  curRes: Record<string, any>;
  setOAMessageRun: (res: Record<string, any>) => any;
  taskId: string;
}

/** 申请管理上下文 */
const context: IChangeContextAPI = {
  styleFixCls: '',
  infoObj: {},
  reloadDetail: () => {},
  invalidState: {},
  setInvalidState: () => {},
  curRes: {},
  setOAMessageRun: () => {},
  taskId: '',
};

const ChangeControllerContext = React.createContext<IChangeContextAPI>(context);

export { ChangeControllerContext };
